package com.example.demo.repository;

import com.example.demo.domain.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student,Integer> {
    public List<Student> findByName(String name);

    public List<Student>  findByNameLike(String name);


    /**
     * 返回小于指定成绩的学生
     * @param score
     * @return
     */
    @Query("select o from tb_student o where o.score<?1")
    public List<Student>  getByStudentsScoreLess(Integer score);
}
